<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/print.jsp" %>

<html>
  <head>
    <title>交费打印</title>
  </head>
  
  <body>
    <center>
    	<s:form name="frm" id="frm" method="post" action="" namespace="">
    		<div class="onlyShow">
    		<jsp:include page="/jsp/outward/business/common/menuLink.jsp">
    			<jsp:param name="menuLink" value="[{'name':'费用管理'},{'name':'收据打印'}]"/>
    			<jsp:param name="width" value="40%"/>
    		</jsp:include>
    		</div>
    		
    		<s:hidden name="ct.id" id="tempId"></s:hidden>
    		<s:hidden name="tuition.child.id" id="childId"></s:hidden>
    		<s:hidden name="tuition.totalAmount" id="totalAmount"></s:hidden>
    		<s:hidden name="tuition.id" id="tuitionId"></s:hidden>
    		
    		<div id="baseDiv">
	    		<table id="baseTb" style="width:190mm;height:70mm;font-size:14px;" cellspacing="1" cellpadding="3" border="0">
	    			<tr bgcolor="#FFFFFF">
	    				<td align="center" class="label" colspan="4">
	    					<font style="font-size:19px; font-weight:bold;">东伶珑幼教集团</font>
	    				</td>
	    			</tr>
	    			<tr bgcolor="#FFFFFF">
	    				<td align="center" class="label" colspan="4">
	    					保教费伙食费专用收据
	    				</td>
	    			</tr>
	    			<tr bgcolor="#FFFFFF">
	    				<td width="50%" align="left" class="label" height="22px" colspan="2">
	    					<s:property value="tuition.kindergarten.kgName"/>
	    				</td>
	    				<td width="50%" align="left" class="label" colspan="2">
	    					单号：<s:property value="tuition.tuitionNo"/>
	    				</td>
	    			</tr>
	    			<tr bgcolor="#FFFFFF">
	    				<td align="left" class="label" height="22px">
	    					姓名：<s:property value="tuition.child.childName"/>
	    				</td>
	    				<td align="left" class="label">
	    					班级：<s:property value="tuition.cla.className"/>
	    				</td>
	    				<td align="left" class="label">
	    					学童编号：<s:property value="tuition.child.childNum"/>
	    				</td>
	    				<td align="left" class="label">
	    					交费日期：<s:date name="tuition.payDate" format="yyyy-MM-dd"/>
	    				</td>
	    			</tr>
	    			<tr>
	    				<td colspan="4">
	    					<table width="100%" cellpadding="3" cellspacing="1" style="background:#000000">
	    						<tr bgcolor="#FFFFFF">
	    							<td align="center">
	    								保教时间
	    							</td>
	    							<s:iterator value="titleBj" status="s">
				    					<td align="center">
				    						<s:property value="indexName" />(元)
				    					</td>
				    				</s:iterator>
	    						</tr>
			    				<s:iterator value="valueBj" status="s" var="v">
			    				<tr bgcolor="#FFFFFF">
			    					<td align="center">
			    						<s:property value="tuitionDateStart" />至<s:property value="tuitionDateEnd" />
			    					</td>
			    					<s:iterator value="titleBj" status="s" var ="t">
			    					<td align="center">
			    						<s:property value="%{#v.get(#t.indexName)}" />
			    					</td>
			    					</s:iterator>
			    				</tr>
			    				</s:iterator>
			    				<tr bgcolor="#FFFFFF">
				   					<td colspan="3" align="left">
				   						合计：<s:property value="intTotal1"/> 元
				   					</td>
				   				</tr>
				   				<tr bgcolor="#FFFFFF">
				   					<td colspan="3" align="left">
				   						备注：<s:property value="tuition.remark"/> 
				   					</td>
				   				</tr>
		    				</table>
	    				</td>
	    			</tr>
	    			<tr>
		    			<td colspan="2" align="left">收款人：</td>
		    			<td colspan="2" align="left">收款单位(盖章)：</td>
	    			</tr>
	    		</table>
    		</div>
    		
    		<table width="100%" cellspacing="0" class="onlyShow">
    			<tr>
    				<td align="center" valign="bottom" height="30">
					    <input onclick="viewThisBase()" type="button" value="打印预览" />
					    <input onclick="printThisBase()" type="button" value="直接打印" />
    				</td>
    			</tr>
    		</table>
    		
    		<div class="onlyShow">
    		<br/>
    		</div>
    		<s:if test="title.size()>0">
    		<HR class="onlyShow" style="FILTER: progid:DXImageTransform.Microsoft.Shadow(color:#987cb9,direction:145,strength:15)" width="80%" color=#987cb9 SIZE=1 />
    		<br/>
    		<div id="otherDiv">
	    		<table id="otherTb" style="width:190mm;height:70mm;font-size:14px;" cellspacing="1" cellpadding="3"  border="0">
	    			<tr bgcolor="#FFFFFF">
	    				<td align="center" class="label" colspan="4">
	    					<font style="font-size:19px; font-weight:bold;">代收代支专用收据</font>
	    				</td>
	    			</tr>
	    			<tr bgcolor="#FFFFFF">
	    				<td width="50%" align="left" class="label" height="22px" colspan="2">
	    					<%--
	    					<s:property value="tuition.kindergarten.kgName"/>
	    					--%>
	    				</td>
	    				<td width="50%" align="left" class="label" colspan="2">
	    					单号：<s:property value="tuition.tuitionNo"/>
	    				</td>
	    			</tr>
	    			<tr bgcolor="#FFFFFF">
	    				<td align="left" class="label" height="22px">
	    					姓名：<s:property value="tuition.child.childName"/>
	    				</td>
	    				<td align="left" class="label">
	    					班级：<s:property value="tuition.cla.className"/>
	    				</td>
	    				<td align="left" class="label">
	    					学童编号：<s:property value="tuition.child.childNum"/>
	    				</td>
	    				<td align="left" class="label">
	    					交费日期：<s:date name="tuition.payDate" format="yyyy-MM-dd"/>
	    				</td>
	    			</tr>
	    			<tr>
	    				<td colspan="4">
	    					<table width="100%" cellpadding="3" cellspacing="1" style="background:#000000">
	    						<tr bgcolor="#FFFFFF">
	    							<!-- <td align="center">
	    								保教月份
	    							</td>
	    							 -->
	    							<s:iterator value="title" status="s">
				    					<td align="center">
				    						<s:property value="indexName" />(元)
				    					</td>
				    				</s:iterator>
	    						</tr>
			    				<s:iterator value="value" status="s" var ="vv">
			    				<tr align="center" bgcolor="#FFFFFF">
			    					<!--<td>
			    						<s:property value="month" />
			    					</td>-->
			    					<s:iterator value="title" status="s" var ="tt">
			    					<td align="center">
			    						<s:property value="%{#vv.get(#tt.indexName)}" />
			    					</td>
			    					</s:iterator>
			    				</tr>
			    				</s:iterator>
			    				<tr bgcolor="#FFFFFF">
				   					<td colspan="<s:property value='title.size' />" align="left">
				   						合计：<s:property value="intTotal2"/> 元
				   					</td>
				   				</tr>
				   				<tr bgcolor="#FFFFFF">
				   					<td colspan="<s:property value='title.size' />" align="left">
				   						备注：<s:property value="tuition.remarkOfOther"/> 
				   					</td>
				   				</tr>
	    					</table>
	    				</td>
	    			</tr>
	    			<tr>
		    			<td colspan="2" align="left">收款人：</td>
		    			<td colspan="2" align="left">收款单位(盖章)：</td>
	    			</tr>
	    		</table>
	    	</div>
    		
    		<table width="100%" cellspacing="0" class="onlyShow">
    			<tr>
    				<td align="center" valign="bottom" height="30">
					    <input onclick="viewThisOther()" type="button" value="打印预览" />
					    <input onclick="printThisOther()" type="button" value="直接打印" />
    				</td>
    			</tr>
    		</table>
    		</s:if>
    		
    	</s:form>
    	
    	<jsp:include page="/jsp/login/business/common/printObject.jsp"></jsp:include>
    </center>
    
    <script type="text/javascript">
	var LODOP; //声明为全局变量 
	
    function checkIsInstall() {	
		try{
		    LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
		 }catch(err){
			alert("Error:本机未安装或需要升级!");
 		 }
	}

	function createOneFormPage(parentId, top, left, width, height){
		LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));  
		LODOP.PRINT_INIT('');
		LODOP.SET_PRINT_STYLE('FontSize',18);
		LODOP.SET_PRINT_STYLE('Bold',1);
		LODOP.ADD_PRINT_HTM(top,left,width,height,document.getElementById(parentId).innerHTML);
	}
	
    function viewThisBase()
    {
    	checkIsInstall();
		createOneFormPage('baseDiv', '0mm', '6mm', '192mm', '90mm');
		LODOP.PREVIEW();
    }
    
    function viewThisOther()
    {
    	checkIsInstall();
		createOneFormPage('otherDiv', '0mm', '6mm', '192mm', '90mm');
		LODOP.PREVIEW();
    }

    function printThisBase()
    {
    	checkIsInstall();
		createOneFormPage('baseDiv', '0mm', '6mm', '192mm', '90mm');
		LODOP.PRINT();
    }
    
    function printThisOther()
    {
    	checkIsInstall();
		createOneFormPage('otherDiv', '0mm', '6mm', '192mm', '90mm');
		LODOP.PRINT();
    }
    </script>
  </body>
</html>
